package com.example.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.common.model.CommonResult;
import com.example.entity.domain.Hierarchy;
import com.example.entity.domain.SensitiveType;
import com.example.entity.dto.BaseDTO;
import com.example.entity.vo.SensitiveTypeVo;
import com.example.service.HierarchicService;
import com.example.service.SensitiveTypeService;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author: zhuxiaokang
 * @CreateTime: 2025-05-07
 * @Description: 敏感类型
 * @Version: 1.0
 */
@Tag(name = "敏感类型", description = "敏感类型")
@RestController
@RequestMapping("/sensitiveType")
public class SensitiveTypeController {


    @Resource
    private SensitiveTypeService sensitiveTypeService;


    @RequestMapping("/list")
    public CommonResult<Page<SensitiveType>> list(@RequestBody BaseDTO baseDTO) {
        return CommonResult.success(sensitiveTypeService.list(baseDTO));
    }



    @RequestMapping("/add")
    public CommonResult<Boolean> add(@RequestBody SensitiveType sensitiveType) {
        return CommonResult.success(sensitiveTypeService.add(sensitiveType));
    }


    @RequestMapping("/delete")
    public CommonResult<Boolean> delete(@RequestParam("id") Integer id) {
        return CommonResult.success(sensitiveTypeService.delete(id));
    }


    @RequestMapping("/update")
    public CommonResult<Boolean> update(@RequestBody SensitiveType sensitiveType) {
        return CommonResult.success(sensitiveTypeService.update(sensitiveType));
    }

    @RequestMapping("/getSensitiveTypeList")
    public CommonResult<List<SensitiveTypeVo>> getSensitiveTypeList() {
        return CommonResult.success(sensitiveTypeService.getSensitiveTypeList());
    }
}
